<template>
  <div class="table-box">
    <div class="operation-box">
      <div class="input-box">
        任务编号：
        <el-input
          v-model="search"
          placeholder="请输入关键字"
          class="input__item"
        />
        <el-button type="danger">查询</el-button>
      </div>

      <el-button type="primary">
        <el-icon><CirclePlus /></el-icon>
        制定消缺任务
      </el-button>
    </div>

    <el-table
      :data="tableData"
      stripe
      border
      table-layout="auto"
      style="max-width: 100vw; min-width: 1100px"
    >
      <el-table-column prop="id" label="任务编号" />
      <el-table-column prop="task" label="任务名称" />
      <el-table-column prop="bill" label="工作单据" />
      <el-table-column prop="name" label="下发人" />
      <el-table-column prop="time" label="下发时间" />
      <el-table-column prop="state" label="任务状态" />
      <el-table-column prop="completeTime" label="完成时间" />
      <el-table-column prop="isCancel" label="是否取消" />
      <el-table-column label="操作" fixed="right">
        <template #default>
          <el-button size="small"> 查看 </el-button>
          <el-button size="small" type="primary"> 分配 </el-button>
          <el-button size="small" type="danger"> 修改 </el-button>
          <el-button size="small" type="success"> 取消 </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";

const search = ref("");

const tableData = ref([
  {
    id: "RW0245",
    task: "西渭一线任务巡检",
    bill: "任务单",
    name: "线路管理员测试用户01",
    time: "2013/12/12",
    state: 0,
    completeTime: "2013/12/12",
    isCancel: false,
  },
  {
    id: "RW0245",
    task: "西渭一线任务巡检",
    bill: "第一种单据",
    name: "线路管理员测试用户01",
    time: "2013/12/12",
    state: 0,
    completeTime: "2013/12/12",
    isCancel: false,
  },
  {
    id: "RW0245",
    task: "西渭一线任务巡检",
    bill: "第二种单据",
    name: "线路管理员测试用户01",
    time: "2013/12/12",
    state: 0,
    completeTime: "2013/12/12",
    isCancel: false,
  },
  {
    id: "RW0245",
    task: "西渭一线任务巡检",
    bill: "任务单",
    name: "线路管理员测试用户01",
    time: "2013/12/12",
    state: 0,
    completeTime: "2013/12/12",
    isCancel: false,
  },
]);
</script>

<style scoped>
.table-box {
  width: fit-content;
  margin: 0 auto;
}

.operation-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-box {
  color: #747070;
  font-size: 14px;
}

.input__item {
  width: 250px;
  margin: 10px;
}
</style>
